<?php
namespace Home\Model;

use Think\Model;

	class newsModel{

		public $_table = 'news';
		function findAll_orderby_dateline(){
			$data = M('news')->order('id desc')->select();
			return $data;
		}
		//查询资讯
		function findzx_orderby_dateline(){
			$data = M('news')->order('id desc')->limit('5')->where("`column`='资讯'")->select();
			return $data;
		}
		//查询话题
		function findht_orderby_dateline(){
			$data = M('news')->order('id desc')->limit('7')->where("`column`='新闻'")->select();
			return $data;
		}
		//房源—海邻+介绍
		//查询话题
		function findjs_orderby_dateline(){
			$data = M('news')->where("`column`='介绍'")->select();
			return $data;
		}
		function findOne_by_id($id){
			echo $id;
			$where="`id`=".$id;
			$data = M('news')->where($where)->select();
			var_dump($data);
			return $data;
		}

		function del_by_id($id){
			return M ( 'news' )->delete ( $id );;
		}

		function count(){
			return M('news')->count();
		}
	}
?>